username = "admin"  # 预设用户名
password = "123456"  # 预设密码
count = 0  # 记录密码错误次数

while count < 3:
    input_username = input("请输入用户名：")
    input_password = input("请输入密码：")
    if input_username == username and input_password == password:
        print("登录成功")
        break
    else:
        count += 1
        print(f"用户名或密码错误，还有{3 - count}次机会")
else:
    print("密码错误次数过多，账户锁定")